package demo1.Assignment2;

import demo1.Assignment2.entity.Brand;
import demo1.Assignment2.entity.Colour;
import demo1.Assignment2.factory.AbstartPhoneFactory;

import java.util.Scanner;

public class PhoneTest {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入您想购买的手机品牌： 1：苹果、2：华为");
        int brand = sc.nextInt();
        System.out.println("请输入您中意的手机颜色： 1：白色、2：黑色");
        int colour = sc.nextInt();

        PhoneProducer p = new PhoneProducer();
        AbstartPhoneFactory bf = p.getPhoneFactory(Constant.PhoneAutribute.BRAND.getValue());
        Brand brand1 = bf.getBrand(brand);

        AbstartPhoneFactory cf = p.getPhoneFactory(Constant.PhoneAutribute.COLOUR.getValue());
        Colour colour1 = cf.getColour(colour);
        System.out.println("brand:"+brand1.brand()+"    colour:"+colour1.colour());
    }
}
